import java.util.*;
import java.text.*;

public class testVerify
{
    public static void main(String[]args)
    {
	Scanner keybd = new Scanner(System.in);
	CalLogic mycal = new CalLogic();

	String input = new String();
	String preinput = new String("Done");
	String date = new String();
	String time = new String();
	String hours = new String();
	String minutes = new String();
	String seconds = new String();

	do
	{
	    System.out.print("Date or Time (Done to quit): ");
	    input = keybd.nextLine();
	    System.out.println();

	    if(input.equalsIgnoreCase("R"))
	    {
		input = preinput;
	    }
	    
	    if(input.equalsIgnoreCase("Date"))
	    {
		System.out.print("Date (MM/DD/YYYY): ");
		date = keybd.nextLine();
		System.out.println("Valid = " + mycal.validDate(date));
		System.out.println();
	    }
	    else if(input.equalsIgnoreCase("Time"))
	    {
		System.out.print("Time (hours:minutes): ");
		//hours = keybd.nextLine();
		//minutes = keybd.nextLine();
		//seconds = keybd.nextLine();
		//time = hours + ':' + minutes + ':' + seconds;
		time = keybd.nextLine();
		System.out.println("Valid = " + mycal.validTime(time));
		System.out.println();
	    }
	    else if(input.equalsIgnoreCase("done"))
	    {
	    }
	    else
	    {
		System.out.println("You must enter 'Date' or 'Time'");
		System.out.println("If you are done, enter 'Done'");
		System.out.println();
	    }

	    preinput = input;
	}
	while(!input.equalsIgnoreCase("done"));
    }
}
